/**
 * 创建员工服务
 * @param {*} params
 * @returns
 */
const createComponent = function (params) {
  return fetch("/api/v1/component/create?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 获取部件列表服务
 * @param {*} params
 * @returns
 */
const getComponent = function (params) {
  return fetch("/api/v1/component/list?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 编辑部件服务
 * @param {*} params
 * @returns
 */
const updateComponent = function (params) {
  return fetch("/api/v1/component/update?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
/**
 * 删除部件服务
 * @param {*} params
 * @returns
 */
const deleteComponent = function (params) {
  return fetch("/api/v1/component/delete?" + new Date().getTime(), {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(params),
  });
};
export default {
  createComponent,
  getComponent,
  updateComponent,
  deleteComponent,
};
